//go:build wireinject
// +build wireinject

package injector

import (
	"alarm_service/internal/api"
	"alarm_service/internal/batch_processor"
	"alarm_service/internal/config"
	"alarm_service/internal/db"
	"alarm_service/internal/repo"
	"alarm_service/internal/router"
	"alarm_service/internal/usecase"
	"github.com/google/wire"
)

// 这个文件如果跟main.go放在一起，就会不能自动引入，需要配置，不是很方便
// 单独放在一个包内就可以了
var providerSet = wire.NewSet(
	config.ProviderSet,
	db.ProviderSet,
	batch_processor.ProviderSet,
	repo.ProviderSet,
	usecase.ProviderSet,
	api.ProviderSet,
	router.ProviderSet,
	InjectorSet,
)

// BuildInjector 生成注入器
func BuildInjector() (*Injector, error) {
	panic(wire.Build(providerSet))
	return new(Injector), nil
}
